package zumyi12;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 轿车类
 */
@Data
@NoArgsConstructor
public class Car extends AutoMobile {
    private String model;//型号

    public Car(String brand,  String model,String sign,int dayRent) {
        super(brand, sign, dayRent);
        this.model = model;
    }

    public Car(String model) {
        this.model = model;
    }


    //重写了汽车类的计算租金的抽象方法
    @Override
    public double callRent(int days) {
        if (days<=7){
            return days*this.getDayRent();
        }else if (days<=30){
            return days*this.getDayRent()*0.9;
        }else if (days<=150){
            return days*this.getDayRent()*0.8;
        }else {
            return days*this.getDayRent()*0.7;
        }
    }
}
